﻿//添加
var fnCustomAdd = function () {
//    document.getElementById("dialog1_h").innerHTML = "添加客户交往记录";
//    document.getElementById("EditUIWindow").src = "AutoLoadForm.aspx?r=" + Math.random() + "&entity=Cst_activity";
//    SetMaxDWH(YAHOO.example.container.dialog1);
//    //SetDWH(450, 300, YAHOO.example.container.dialog1);
//    YAHOO.example.container.dialog1.show();

    var pagetitle = "添加客户交往记录";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=Cst_activity"));
    parent.NeedRefreshPage = this;
}

//-----------------------------------------
//编辑
//-----------------------------------------
var fnCustomEdit = function (key) {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var pagetitle = "修改客户交往记录—" + record.getData("Atv_cust_name"); ;
    parent._employeeTitle = pagetitle;
    //parent.addTabs(pagetitle, encodeURI("../../Extend/AutoLoadForm.aspx?r=" + Math.random() + "&entity=Cst_customer"));
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=Cst_activity&id=" + record.getData(const_entityID)));
    parent.NeedRefreshPage = this;
}

/*格式化的方法*/
var fnFormatDesc = function (elCell, oRecord, oColumn, sData) {
    //alert(oColumn + "wolf" + sData);
    //var desc = oRecord.getData("Atv_desc");
    if (sData.length > 33) sData = sData.substring(0, 33) + "...";
    elCell.innerHTML = sData;
}

if (typeof ($) != "undefined") {
    $(document).ready(function () {
        //alert("$(document).ready(function () {");
    });
}

var ValueChanged = function () { //部门发生变化后
    alert("wolf");
}

function GetCust_nameAll(op) {
    alert("GetCust_nameAll");
}